package com.xuecheng.api;

import com.xuecheng.entity.Student;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

@Api(tags = "Hello Api 服务测试",description = "对Hello Api 服务提供接口")
public interface HelloApi {
    @ApiOperation("测试Hello方法")
    String hello();

    @ApiOperation("queryString的测试方法")
    @ApiImplicitParam(name = "num", value = "学成的编号", required = true, dataType = "String", paramType = "query")
    Student modifyStudentNum(@RequestParam("num") String num);

    @ApiOperation("测试Restful风格的参入参数")
    @ApiImplicitParam(name = "name", value = "学成的姓名", required = true, dataType = "String", paramType = "path")
    public Student modifyStudentName(@PathVariable("name") String name);


        @ApiOperation("测试json格式的传入参数")
    public Student modifyStudent(@RequestBody Student student);

    @ApiOperation("测试 queryString 、Restful 和 json 格式的参数")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "学成的编号", required = true, dataType = "String", paramType = "path"),
            @ApiImplicitParam(name = "name", value = "学成的名称", required = true, dataType = "String", paramType = "query")
    })
    public Student mofidyStudentBynNum(@PathVariable("id") String id, @RequestParam("name") String name, @RequestBody Student student);
}
